import Vue from 'vue'
import Vuex from 'vuex'
import router from "@/router";
import app from "./modules/app"
import user from "./modules/user"
import notice from "./modules/notice"
Vue.use(Vuex)
import { taskUpload } from "../api/user";
import { Toast } from "vant";
const store = new Vuex.Store({
  state: {
    count: 0,
    viewDirection: '',
    taskdata: {},
  },
  mutations: {

    setTaskData(state, data) {
      state.taskdata = data;
      console.log(state.taskdata)
    },
    submitTask(state) {
      taskUpload(state.taskdata).then(res => {
        Toast(res.message);
      })
    }

  },
  modules: {
    app,
    user,
    notice,
  }
})
export default store
